<template>
  <div>setup和ref基本使用</div>
  <h3>{{ count }}</h3>
  <button @click="change">{{ "改变数据" }}</button>
</template>

<script lang="ts">
import { defineComponent, ref } from "vue";

export default defineComponent({
  name: "App",
  setup() {
    const count = ref(10); //一般定义一个基本数据类型的响应式数据
    const change = () => {
      count.value++;
    };
    return {
      count,
      change,
    };
  },
});
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
